package com.gcorp.idealgas;

import java.awt.Component;
import java.awt.Container;
import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class AddNewBaffleDialog extends JDialog
{
    AddNewBaffleDialog()
    {
        initUI();
    }
    private void initUI()
    {
        JPanel panel = (JPanel)getContentPane();
        panel.setLayout(null);
        
        String [] items = {
        	"Line",
        	"Rectangle"
        };
        
        final JLabel    setType = new JLabel("Set the type");
        final JComboBox getType = new JComboBox(items);

        
        addElement(panel,setType,30,40,100,20);
        addElement(panel,getType,120,40,100,20);
        
        panel.setBorder(BorderFactory.createEmptyBorder(30, 50, 30, 50));
        
        JButton addButton = new JButton("Add");
        addButton.addActionListener(new ActionListener()
        {

            @Override
            public void actionPerformed(ActionEvent arg0) 
            {
               
            }
            
        });
        addElement(panel,addButton,30,70,100,20);
        //add(panel);
        
        setTitle("Add New Baffle");
        setSize(400,300);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(HIDE_ON_CLOSE);
    }
    private void addElement(Container c, Component e,int x,int y,int h,int w)
    {
        e.setBounds(x, y, h, w);
        c.add(e);
    }
}